import {request} from "../request/index.js";
import {config} from "../config/index.js";

const userDetail = async function(uid, callBack, handle) {
    let params = { uid }
    await request.get(config.url.userUrls.userDetail,params).then(callBack).catch(handle)
}

const userAccount = async function(callBack, handle) {
    await request.post(config.url.userUrls.userAccount).then(callBack).catch(handle)
}

// 获取用户歌单
const userPlayList = async function(uid, callBack, handle) {
    let params = {
        uid
    }
    await request.get(config.url.userUrls.userPlayList, params).then(callBack).catch(handle)
}

// 获取用户电台
const userDj = async function(uid, callBack, handle) {
    let params = {
        uid
    }
    await request.get(config.url.userUrls.userDj, params).then(callBack).catch(handle)
}

export const userApi = {
    userDetail,
    userAccount,
    userPlayList,
    userDj
}